<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
    <img id="img" src="http://q6cu3t6jv.bkt.clouddn.com/1063705989926227968?t=1616204161907" alt="">
    <script>
      const img = document.querySelector('#img')
      // console.log(img)
      // img.onerror = function(){
      //   console.log('图片路径加载失败')
      // }

      img.addEventListener('error', function(){
        console.log('图片路径加载失败')
      })
    </script>
</body>
</html>